<?php
class TestsController extends AppController
{
    var $name='Tests';
  	//var $uses = null;
    function view()
    {
         $kq=0;
        if(!empty($this->data))
         {
              if($this->data['Test']['pt']=='cong')
               {
                $kq=$this->data['Test']['so1'] + $this->data['Test']['so2'];
               } 
               elseif($this->data['Test']['pt']=='tru')
               {
                $kq=$this->data['Test']['so1'] - $this->data['Test']['so2'];
               }
               elseif($this->data['Test']['pt']=='nhan')
                {
                $kq=$this->data['Test']['so1'] * $this->data['Test']['so2'];
               }
               elseif($this->data['Test']['pt']=='chia')
                {
                $kq=$this->data['Test']['so1'] / $this->data['Test']['so2'];
               }
         }
          $this->set(compact('kq'));    
        
    }
	
}
?>